import axios from './index'

const preUrl = ''


// 查询用户统计数据
const getUserdata = {
  p: [`get,/userstatic/*/*/*`],
  r: (gameId, type) => {
    axios.defaults.headers.permission = `get,/userstatic/*/*/*`
    return axios.get(`${preUrl}/userstatic/${Cookie.get('areaCode')}/${gameId}/${type}`)
  }
}

// 查询消费统计日周月数据
const getConsumeData = {
  p: [`get,/topup/*`],
  r: params => {
    axios.defaults.headers.permission = `get,/topup/*`
    return axios.get(`${preUrl}/topup/${Cookie.get('areaCode')}`)
  }
}

// 查询消费统计图标数据
const getConsumeChartData = {
  p: [`get,/topup/*/*`],
  r: type => {
    axios.defaults.headers.permission = `get,/topup/*/*`
    return axios.get(`${preUrl}/topup/${Cookie.get('areaCode')}/${type}`)
  }
}

// 查询玩法统计数据
const getMethodsData = {
  p: [`get,/game/count/*/**`],
  r: params => {
    axios.defaults.headers.permission = `get,/game/count/*/**`
    return axios.get(`${preUrl}/game/count/${Cookie.get('areaCode')}`, {
      params
    })
  }
}


export {
  getUserdata,
  getConsumeData,
  getConsumeChartData,
  getMethodsData
}